{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
	<li class="active"><a href="#tab_basic">基础设置</a></li>
	<li><a href="#tab_vip">会员设置</a></li>
	<li><a href="#tab_jifen">积分设置</a></li>
	<li><a href="#tab_share">分享设置</a></li>
</ul>
<div class="app-content">
	<style type="text/css">
		.page-heading {
		padding: 5px 0;
		border-bottom: 1px solid #ccc;
		margin-bottom: 20px;
		position: relative;
		margin-left: 15px;
		}
		.select2{width: 100%;}
		.select2-container .select2-choice .select2-arrow b{background-color: #eeeeee}
		.w200{width: 200px;}
		.w60{width: 60px;text-align: right;}
		.form-horizontal .form-group{margin-left: 0;margin-right: 0;}
		.table> thead> tr> th{border: none;}
		.is_default{display: table-block;}
		.is_advanced{display: none;}
		#openids_selector .input-group{width: 100%;}
		.is_sms{display: table-block;}
		.layui-anim-upbit{-webkit-animation-name: layui-upbit;animation-name: layui-upbit;}
		.layui-anim{-webkit-animation-duration: .3s;animation-duration: .3s;-webkit-animation-fill-mode: both;animation-fill-mode: both;}
		.layui-form-selected ul{display: block;}
		.form-control-block, .form-control-inline{position: relative;}
		.layui-form-select ul{display: none;position: absolute;left: 0;top: 37px;margin-bottom: 50px;padding: 0;z-index: 999;width: 100%;border: 1px solid #d2d2d2;max-height: 300px;overflow-y: auto;background-color: #fff;border-radius: 2px;box-shadow: 0 2px 4px rgba(0, 0, 0, .12);box-sizing: border-box;}
		.layui-form-select{position: absolute;margin-top: -18px;display: none;}
	</style>
	<div class="app-form">
			<form action="" method="post" id="setting-form" class="form-horizontal form form-validate">
				<div class="panel panel-default">
					<div class="panel-heading">一卡通设置</div>
					<div class="panel-body">
						<div class="tab-content">
							<div class="tab-pane active" id="tab_basic">
								<div class="form-group">
									<label class="col-sm-2 control-label">是否开启一卡通</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inline1" name="status" value="1" {if intval($settings['status']) == 1}checked{/if}>
											<label for="inline1">开启 </label>
										</div>
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inline2" name="status" value="0" {if intval($settings['status']) == 0 || empty($settings['status'])}checked{/if}>
											<label for="inline2">关闭 </label>
										</div>
									</div>
								</div>
								{if Customized::init('discount858') > 0}
								<div class="form-group">
									<label class="col-sm-2 control-label">新人折扣</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" onclick="$('#newreate').show();" >
											<input type="radio" id="inline3" name="newdiscount" value="1" {if intval($settings['newdiscount']) == 1}checked{/if}>
											<label for="inline3">开启 </label>
										</div>
										<div class="radio radio-success radio-inline" onclick="$('#newreate').hide();" >
											<input type="radio" id="inline4" name="newdiscount" value="0" {if intval($settings['newdiscount']) == 0 || empty($settings['newdiscount'])}checked{/if}>
											<label for="inline4">关闭 </label>
										</div>
									</div>
								</div>

								<div class="form-group" id="newreate"  {if intval($settings['newdiscount']) == 0 || empty($settings['newdiscount'])} style="display: none" {/if}>
									<label class="col-sm-2 control-label">折扣比例</label>
									<div class="col-sm-9">
										<div class="input-group">
											<input type="number" name="newreate" min="0" value="{$settings['newreate']}" class="form-control">
											<span class="input-group-addon">%</span>
										</div>
										<span class="help-block">折扣比例保留整数。</span>
									</div>
								</div>
								{/if}
								<div class="form-group">
									<label class="col-sm-2 control-label">下单开通会员</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="is_openvip2" name="is_openvip" value="0" {if intval($settings['is_openvip']) != 1}checked{/if}>
											<label for="is_openvip2">关闭 </label>
										</div>
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="is_openvip1" name="is_openvip" value="1" {if intval($settings['is_openvip']) == 1}checked{/if}>
											<label for="is_openvip1">开启 </label>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">激活码兑换</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline">
											<input type="radio" id="inlinee2" name="hideact" value="0" {if intval($settings['hideact']) == 0 || empty($settings['hideact'])}checked="checked"{/if}>
											<label for="inlinee2"> 启用</label>
										</div>
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inlinee1" name="hideact" value="1" {if intval($settings['hideact']) == 1}checked="checked"{/if}>
											<label for="inlinee1"> 禁用 </label>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">首页统计框</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inlineRadio9" name="statisticsdiv" value="0" {if intval($settings['statisticsdiv']) == 0 || empty($settings['statisticsdiv'])}checked="checked"{/if}>
											<label for="inlineRadio9"> 隐藏 </label>
										</div>
										<div class="radio radio-success radio-inline">
											<input type="radio" id="inlineRadio10" name="statisticsdiv" value="1" {if intval($settings['statisticsdiv']) == 1}checked="checked"{/if}>
											<label for="inlineRadio10"> 显示</label>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">平日折扣分类栏</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline">
											<input type="radio" id="inlineT2" name="halfcate" value="0" {if intval($settings['halfcate']) == 0 || empty($settings['halfcate'])}checked="checked"{/if}>
											<label for="inlineT2"> 隐藏</label>
										</div>
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inlineT1" name="halfcate" value="1" {if intval($settings['halfcate']) == 1}checked="checked"{/if}>
											<label for="inlineT1"> 显示 </label>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">礼包分类栏</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inlineR1" name="packagecate" value="0" {if intval($settings['packagecate']) == 1 || empty($settings['packagecate'])}checked="checked"{/if}>
											<label for="inlineR1"> 隐藏 </label>
										</div>
										<div class="radio radio-success radio-inline">
											<input type="radio" id="inlineR2" name="packagecate" value="1" {if intval($settings['packagecate']) == 1 }checked="checked"{/if}>
											<label for="inlineR2"> 显示</label>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">锁定续费类型</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inlineRadio11" name="renewstatus" value="1" {if intval($settings['renewstatus']) == 1}checked="checked"{/if}>
											<label for="inlineRadio11"> 开启 </label>
										</div>
										<div class="radio radio-success radio-inline">
											<input type="radio" id="inlineRadio12" name="renewstatus" value="0" {if intval($settings['renewstatus']) == 0 || empty($settings['renewstatus'])}checked="checked"{/if}>
											<label for="inlineRadio12"> 关闭</label>
										</div>
										<span class="help-block">开启后,续费一卡通的用户只能选择当前一卡通种类</span>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">开卡弹幕</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="notice3" name="noticestatus" value="0" {if intval($settings['noticestatus']) == 0 || empty($settings['noticestatus'])}checked{/if}>
											<label for="notice3">关闭 </label>
										</div>
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="notice1" name="noticestatus" value="1" {if intval($settings['noticestatus']) == 1}checked{/if}>
											<label for="notice1">启用</label>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">开卡金额结算</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="notice4" name="settlement" value="0" {if intval($settings['settlement']) == 0 || empty($settings['settlement'])}checked{/if}>
											<label for="notice4">代理 </label>
										</div>
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="notice5" name="settlement" value="1" {if intval($settings['settlement']) == 1}checked{/if}>
											<label for="notice5">平台</label>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">礼包出资方</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="notice7" name="rptomoney" value="1" {if intval($settings['rptomoney']) == 1}checked{/if}>
											<label for="notice7">代理</label>
										</div>
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="notice6" name="rptomoney" value="0" {if intval($settings['rptomoney']) == 0 || empty($settings['rptomoney'])}checked{/if}>
											<label for="notice6">平台 </label>
										</div>
										<span class="help-block">礼包设置结算金额后的出资方。</span>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">开通表单</label>
									<div class="col-sm-6">
										<select name="diyformid" class="form-control chosen-select">
											<option value="" >请选择开通表单</option>
											{loop $diyFormList $form}
											<option value="{$form['id']}" {if $settings['diyformid'] == $form['id']}selected="selected"{/if}>{$form['title']}</option>
											{/loop}
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">买单不优惠金额默认提示</label>
									<div class="col-sm-9">
										<input type="text" name="limit" placeholder="请询问服务员输入不参与优惠金额" class="form-control" value="{$settings['limit']}" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">首页卡面文本颜色</label>
									<div class="col-sm-9">
										<input type="color" style="width: 20%;" name="cardTextColor"  class="form-control" value="{$settings['cardTextColor']}" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">首页卡背图片</label>
									<div class="col-sm-9">
										{php echo attachment_select('cardbgimg', $settings['cardbgimg']);}
										<span class="help-block">一卡通背景图，建议大小750X530;<a href="{php echo URL_H5_RESOURCE . '/image/memberBacImg.png';}" target="_blank">系统示例下载</a> </span>
									</div>
								</div>

							</div>
							<div class="tab-pane" id="tab_vip">
								<div class="form-group">
									<label class="col-sm-2 control-label">一卡通模式</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline"  onclick="$('#show').show();">
											<input type="radio" id="inlineRadio1" name="halfcardtype" value="1" {if intval($settings['halfcardtype']) == 1}checked="checked"{/if}>
											<label for="inlineRadio1"> 联盟模式 </label>
										</div>
										<div class="radio radio-success radio-inline" onclick="$('#show').hide();">
											<input type="radio" id="inlineRadio2" name="halfcardtype" value="2" {if intval($settings['halfcardtype']) == 2}checked="checked"{/if}>
											<label for="inlineRadio2"> 地区模式 </label>
										</div>
										<span class="help-block">联盟模式：所有代理区域通用。地区模式：每个地区单独收费，互不影响。默认地区模式</span>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">一卡通卡面</label>
									<div class="col-sm-9">
										{php echo attachment_select('cardimg', $settings['cardimg']);}
									</div>
								</div>
								{if is_file(PATH_MODULE.'TnSrtWDJ.log')}
								<div class="form-group">
									<label class="col-sm-2 control-label">特权使用间隔</label>
									<div class="col-sm-9">
										<div class="input-group">
											<span class="input-group-addon">每</span>
											<input type="text" name="use_space" class="form-control" value="{$settings['use_space']}" />
											<span class="input-group-addon">天，限使用</span>
											<input type="text" name="use_space_times" class="form-control" value="{$settings['use_space_times']}" />
											<span class="input-group-addon">次，每次间隔最少</span>
											<input type="text" name="use_space_days" class="form-control" value="{$settings['use_space_days']}" />
											<span class="input-group-addon">天</span>
										</div>
										<span class="help-block">特权折扣、礼包使用间隔时间，不填或留空则不限制用户使用间隔 </span>
									</div>
								</div>
								{/if}
								<div class="form-group">
									<label class="col-sm-2 control-label">用户会员等级</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inline7" name="levelstatus" value="0"  {if intval($settings['levelstatus']) == 0 || empty($settings['levelstatus'])}checked{/if}>
											<label for="inline7">隐藏</label>
										</div>
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inline8" name="levelstatus" value="1"  {if intval($settings['levelstatus']) == 1}checked{/if}>
											<label for="inline8">显示</label>
										</div>
										<span class="help-block">设置是否在用户会员卡上显示用户的会员等级</span>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">会员权益说明</label>
									<div class="col-sm-9">
										{php echo tpl_diy_editor_create('describe',$settings['describe']);}
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">非会员说明</label>
									<div class="col-sm-9">
										{php echo tpl_diy_editor_create('nodescribe',$settings['nodescribe']);}
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">特权项目对非会员展示</label>
									<div class="col-sm-9">
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inline17" name="unshowtab" value="1" {if intval($settings['unshowtab']) == 1}checked{/if}>
											<label for="inline17">隐藏</label>
										</div>
										<div class="radio radio-success radio-inline" >
											<input type="radio" id="inline18" name="unshowtab" value="0" {if intval($settings['unshowtab']) == 0 || empty($settings['unshowtab'])}checked{/if}>
											<label for="inline18">显示</label>
										</div>
										<span class="help-block">一卡通页面特权是否对非会员显示</span>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">选项卡设置</label>
									<div class="col-sm-9">
										<table class="table table-hover">
											<thead class="bannerbar-inner">
											<tr>
												<th style="width:20%;text-align: center;">选项名称</th>
												<th style="width:20%;text-align: center;">修改名称</th>
												<th style="width:15%;text-align: center;">排序(数字越大越靠前)</th>
												<th style="width:25%;text-align: center;">列表排序方式</th>
												<th style="width:20%;text-align: center;">开关</th>
											</tr>
											</thead>
											<tbody>
											<tr>
												<td style="text-align: center;">特权折扣</td>
												<td style="text-align: center;"><input type="text" class="form-control" placeholder="特权折扣"  name="plugin[zkname]"  value="{$plugin['zkname']}"/></td>
												<td style="text-align: center;"><input class="form-control" type="number"  name="plugin[zkorder]"  value="{$plugin['zkorder']}"/></td>
												<td>
													<select name="plugin[zksort]" style="width: 100%;">
														<option value="2" {if $plugin['zksort'] == 2 || empty($plugin['zksort'])} selected="selected" {/if}>店铺距离</option>
														<option value="3" {if $plugin['zksort'] == 3} selected="selected" {/if}>推荐设置</option>
														<option value="1" {if $plugin['zksort'] == 1} selected="selected" {/if}>创建时间</option>
														<option value="4" {if $plugin['zksort'] == 4} selected="selected" {/if}>浏览人气</option>
													</select>
												</td>
												<td style="text-align: center;">
													<input type="checkbox" class="js-switch" name="plugin[zkstatus]" value="1" {if $plugin['zkstatus']}checked="checked" {/if}>
												</td>
											</tr>
											<tr>
												<td style="text-align: center;">平日折扣</td>
												<td style="text-align: center;"><input type="text" class="form-control" placeholder="平日折扣"  name="plugin[przkname]"  value="{$plugin['przkname']}"/></td>
												<td style="text-align: center;"><input class="form-control" type="number"  name="plugin[przkorder]"  value="{$plugin['przkorder']}"/></td>
												<td>
													<select name="plugin[przksort]" style="width: 100%;">
														<option value="2" {if $plugin['przksort'] == 2 || empty($plugin['przksort'])} selected="selected" {/if}>店铺距离</option>
														<option value="3" {if $plugin['przksort'] == 3} selected="selected" {/if}>推荐设置</option>
														<option value="1" {if $plugin['przksort'] == 1} selected="selected" {/if}>创建时间</option>
														<option value="4" {if $plugin['przksort'] == 4} selected="selected" {/if}>浏览人气</option>
													</select>
												</td>
												<td style="text-align: center;">
													<input type="checkbox" class="js-switch" name="plugin[przkstatus]" value="1" {if $plugin['przkstatus']}checked="checked" {/if}>
												</td>
											</tr>
											<tr>
												<td style="text-align: center;">免费礼包</td>
												<td style="text-align: center;"><input class="form-control" placeholder="免费礼包" type="text"  name="plugin[lbname]"  value="{$plugin['lbname']}"/></td>
												<td style="text-align: center;"><input class="form-control" type="number"  name="plugin[lborder]"  value="{$plugin['lborder']}"/></td>
												<td>
													<select name="plugin[lbsort]" style="width: 100%;">
														<option value="2" {if $plugin['lbsort'] == 2 || empty($plugin['lbsort'])} selected="selected" {/if}>店铺距离</option>
														<option value="3" {if $plugin['lbsort'] == 3} selected="selected" {/if}>推荐设置</option>
														<option value="1" {if $plugin['lbsort'] == 1} selected="selected" {/if}>创建时间</option>
														<option value="4" {if $plugin['lbsort'] == 4} selected="selected" {/if}>浏览人气</option>
													</select>
												</td>
												<td style="text-align: center;">
													<input type="checkbox" class="js-switch" name="plugin[lbstatus]" value="1" {if $plugin['lbstatus']}checked="checked" {/if}>
												</td>
											</tr>
											{if p('rush')}
											<tr>
												<td style="text-align: center;">尊享抢购</td>
												<td style="text-align: center;"><input class="form-control" type="text" placeholder="尊享抢购"  name="plugin[qgname]"  value="{$plugin['qgname']}"/></td>
												<td style="text-align: center;"><input class="form-control" type="number"  name="plugin[qgorder]"  value="{$plugin['qgorder']}"/></td>
												<td>
													<select name="plugin[qgsort]" style="width: 100%;">
														<option value="2" {if $plugin['qgsort'] == 2 || empty($plugin['qgsort'])} selected="selected" {/if}>店铺距离</option>
														<option value="3" {if $plugin['qgsort'] == 3} selected="selected" {/if}>推荐设置</option>
														<option value="1" {if $plugin['qgsort'] == 1} selected="selected" {/if}>创建时间</option>
														<option value="4" {if $plugin['qgsort'] == 4} selected="selected" {/if}>浏览人气</option>
													</select>
												</td>
												<td style="text-align: center;">
													<input type="checkbox" class="js-switch" name="plugin[qgstatus]" value="1" {if $plugin['qgstatus']}checked="checked" {/if}>
												</td>
											</tr>
											{/if}
											{if p('groupon')}
											<tr>
												<td style="text-align: center;">特惠团购</td>
												<td style="text-align: center;"><input class="form-control" type="text" placeholder="特惠团购"  name="plugin[tgname]"  value="{$plugin['tgname']}"/></td>
												<td style="text-align: center;"><input class="form-control" type="number"  name="plugin[tgorder]"  value="{$plugin['tgorder']}"/></td>
												<td>
													<select name="plugin[tgsort]" style="width: 100%;">
														<option value="2" {if $plugin['tgsort'] == 2 || empty($plugin['tgsort'])} selected="selected" {/if}>店铺距离</option>
														<option value="3" {if $plugin['tgsort'] == 3} selected="selected" {/if}>推荐设置</option>
														<option value="1" {if $plugin['tgsort'] == 1} selected="selected" {/if}>创建时间</option>
														<option value="4" {if $plugin['tgsort'] == 4} selected="selected" {/if}>浏览人气</option>
													</select>
												</td>
												<td style="text-align: center;">
													<input type="checkbox" class="js-switch" name="plugin[tgstatus]" value="1" {if $plugin['tgstatus']}checked="checked" {/if}>
												</td>
											</tr>
											{/if}
											{if p('wlcoupon')}
											<tr>
												<td style="text-align: center;">专属卡券</td>
												<td style="text-align: center;"><input class="form-control" type="text" placeholder="专属卡券" name="plugin[kqname]"  value="{$plugin['kqname']}"/></td>
												<td style="text-align: center;"><input class="form-control" type="number"  name="plugin[kqorder]"  value="{$plugin['kqorder']}"/></td>
												<td>
													<select name="plugin[kqsort]" style="width: 100%;">
														<option value="2" {if $plugin['kqsort'] == 2 || empty($plugin['kqsort'])} selected="selected" {/if}>店铺距离</option>
														<option value="3" {if $plugin['kqsort'] == 3} selected="selected" {/if}>推荐设置</option>
														<option value="1" {if $plugin['kqsort'] == 1} selected="selected" {/if}>创建时间</option>
														<option value="4" {if $plugin['kqsort'] == 4} selected="selected" {/if}>浏览人气</option>
													</select>
												</td>
												<td style="text-align: center;">
													<input type="checkbox" class="js-switch" name="plugin[kqstatus]" value="1" {if $plugin['kqstatus']}checked="checked" {/if}>
												</td>
											</tr>
											{/if}
											{if p('consumption')}
											<tr>
												<td style="text-align: center;">积分商品</td>
												<td style="text-align: center;"><input class="form-control" type="text" placeholder="积分商品" name="plugin[jfname]"  value="{$plugin['jfname']}"/></td>
												<td style="text-align: center;"><input class="form-control" type="number"  name="plugin[jforder]"  value="{$plugin['jforder']}"/></td>
												<td>
													<select name="plugin[jfsort]" style="width: 100%;">
														<option value="3" {if $plugin['jfsort'] == 3 || empty($plugin['jfsort'])} selected="selected" {/if}>推荐设置</option>
														<option value="1" {if $plugin['jfsort'] == 1} selected="selected" {/if}>创建时间</option>
														<option value="4" {if $plugin['jfsort'] == 4} selected="selected" {/if}>浏览人气</option>
													</select>
												</td>
												<td style="text-align: center;">
													<input type="checkbox" class="js-switch" name="plugin[jfstatus]" value="1" {if $plugin['jfstatus']}checked="checked" {/if}>
												</td>
											</tr>
											{/if}
											{if p('wlfightgroup')}
											<tr>
												<td style="text-align: center;">拼团活动</td>
												<td style="text-align: center;"><input class="form-control" type="text" placeholder="拼团活动" name="plugin[ptname]"  value="{$plugin['ptname']}"/></td>
												<td style="text-align: center;"><input class="form-control" type="number"  name="plugin[ptorder]"  value="{$plugin['ptorder']}"/></td>
												<td>
													<select name="plugin[ptsort]" style="width: 100%;">
														<option value="2" {if $plugin['ptsort'] == 2 || empty($plugin['ptsort'])} selected="selected" {/if}>店铺距离</option>
														<option value="3" {if $plugin['ptsort'] == 3} selected="selected" {/if}>推荐设置</option>
														<option value="1" {if $plugin['ptsort'] == 1} selected="selected" {/if}>创建时间</option>
														<option value="4" {if $plugin['ptsort'] == 4} selected="selected" {/if}>浏览人气</option>
													</select>
												</td>
												<td style="text-align: center;">
													<input type="checkbox" class="js-switch" name="plugin[ptstatus]" value="1" {if $plugin['ptstatus']}checked="checked" {/if}>
												</td>
											</tr>
											{/if}

											{if p('bargain')}
											<tr>
												<td style="text-align: center;">砍价活动</td>
												<td style="text-align: center;"><input class="form-control" type="text" placeholder="砍价活动" name="plugin[kjname]"  value="{$plugin['kjname']}"/></td>
												<td style="text-align: center;"><input class="form-control" type="number"  name="plugin[kjorder]"  value="{$plugin['kjorder']}"/></td>
												<td>
													<select name="plugin[kjsort]" style="width: 100%;">
														<option value="2" {if $plugin['kjsort'] == 2 || empty($plugin['kjsort'])} selected="selected" {/if}>店铺距离</option>
														<option value="3" {if $plugin['kjsort'] == 3} selected="selected" {/if}>推荐设置</option>
														<option value="1" {if $plugin['kjsort'] == 1} selected="selected" {/if}>创建时间</option>
														<option value="4" {if $plugin['kjsort'] == 4} selected="selected" {/if}>浏览人气</option>
													</select>
												</td>
												<td style="text-align: center;">
													<input type="checkbox" class="js-switch" name="plugin[kjstatus]" value="1" {if $plugin['kjstatus']}checked="checked" {/if}>
												</td>
											</tr>
											{/if}
											</tbody>
										</table>
										<span class="help-block">不推荐开启平日折扣，平日折扣关闭时，特权折扣列表会显示特权折扣 + 平日折扣商家</span>
									</div>
								</div>
							</div>
							<div class="tab-pane" id="tab_jifen">
								<div class="form-group">
									<label class="col-sm-2 control-label">特权折扣赠送积分</label>
									<div class="col-sm-9">
										<div class="input-group">
											<span class="input-group-addon">订单价格每</span>
											<input type="text" name="carddeduct" min="0" value="{$settings['carddeduct']}" class="form-control">
											<span class="input-group-addon">元赠送1积分</span>
										</div>
										<span class="help-block">如果不填或设置0，则核销不赠送积分</span>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">大礼包赠送积分</label>
									<div class="col-sm-9">
										<div class="input-group">
											<span class="input-group-addon">礼包价格每</span>
											<input type="text" name="packdeduct" min="0" value="{$settings['packdeduct']}" class="form-control">
											<span class="input-group-addon">元赠送1积分</span>
										</div>
										<span class="help-block">如果不填或设置0，则核销不赠送积分</span>
									</div>
								</div>
							</div>
							<div class="tab-pane" id="tab_share">
								<div class="alert alert-info">
									<b>适用模板变量：[昵称] [时间] [系统名称]</b>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">分享标题</label>
									<div class="col-sm-9">
										<input type="text" name="share_title" class="form-control" value="{$settings['share_title']}" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">分享图片</label>
									<div class="col-sm-9">
										{php echo attachment_select('share_image', $settings['share_image']);}
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">分享描述</label>
									<div class="col-sm-9">
										<input type="text" name="share_desc" class="form-control" value="{$settings['share_desc']}" />
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-9">
						<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" />
						<input type="hidden" name="token" value="{$_W['token']}" />
					</div>
				</div>
			</form>
	</div>
</div>

<script>
$(function () {
	window.optionchanged = false;
	$('#myTab a').click(function (e) {
		e.preventDefault();//阻止a链接的跳转行为
		$(this).tab('show');//显示当前选中的链接及关联的content
	})
});
var kw = 1;
function addType() {
    $(".btn-add-type").button("loading");
    $.ajax({
        url: "{php echo web_url('halfcard/halfset/halfcardqa')}&kw="+kw,
        cache: false
    }).done(function (html) {
        $(".btn-add-type").button("reset");
        $("#datas").append(html);
    });
    kw++;
}
function showdaily(flag){
	if(flag){
		$('#showdaily').show();
	}else{
		$('#showdaily').hide();
	}
}
</script>
{php include wl_template('common/footer');}